#pragma once
#include <iostream>
#include "Common.hpp"

class Client
{
    public:
    Client()
    :_fd(gdefaultfd)
    {
    }
    bool OpenPipeForWrite()
    {
        _fd = OpenPipe(gForWrite);
        if(_fd < 0) return false;
        return true;
    }
    //写管道
    int SendPipe(const string& in)
    {
        return ::write(_fd, in.c_str(), in.size());
    }
    void ClosePipe()
    {
        ClosePipeT(_fd);
    }
    ~Client()
    {}
private:
    pid_t _fd;
};